package cn.liccshop.core.backstage.sysRole.service;

import cn.liccshop.core.entity.SysRole;
import cn.liccshop.core.backstage.sysRole.mapper.SysRoleMapper;
import cn.liccshop.core.backstage.sysRole.service.ISysRoleService;
import cn.liccshop.sys.constants.Constants;
import cn.liccshop.sys.exception.MySystemException;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 角色表 服务实现类
 * </p>
 *
 * @author LiCC
 * @since 2019-04-06
 */
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements ISysRoleService {

    @Override
    public List<Map<String, Object>> selectUserIdByRoleId(String roleId) throws MySystemException {
        if (StringUtils.isBlank(roleId)){
            throw new MySystemException("角色ID为空", Constants.INVALID_PARM);
        }
        List<Map<String, Object>> data = baseMapper.selectUserIdByRoleId(roleId);
        return data;
    }
}
